package com.face.console.dao;

import com.face.console.pojo.dto.FieldTypeDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface FieldTypeDtoMapper {
    @Delete({
        "delete from field_type",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into field_type (id, type_name, ",
        "t_explain, type_code)",
        "values (#{id,jdbcType=BIGINT}, #{typeName,jdbcType=VARCHAR}, ",
        "#{tExplain,jdbcType=VARCHAR}, #{typeCode,jdbcType=VARCHAR})"
    })
    int insert(FieldTypeDto record);

    int insertSelective(FieldTypeDto record);

    @Select({
        "select",
        "id, type_name, t_explain, type_code",
        "from field_type",
        "where id = #{id,jdbcType=BIGINT}"
    })
    FieldTypeDto selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FieldTypeDto record);

    @Update({
        "update field_type",
        "set type_name = #{typeName,jdbcType=VARCHAR},",
          "t_explain = #{tExplain,jdbcType=VARCHAR},",
          "type_code = #{typeCode,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(FieldTypeDto record);
}